﻿<html>
<head>
	 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>试过才知道</title>

    <!--<link href="css/bootstrap.css" rel="stylesheet">-->
	<!--<link href="css/bootstrap-responsive.min.css" rel="stylesheet">-->
	<link href="css/productlist.css" rel="stylesheet">
	<link href="css/inspiritas.css" rel="stylesheet">
	<link href="css/carousel.css" rel="stylesheet">
	<script src="js/jquery-1.7.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
	<script src="js/jquery.form.js"></script>
	<script>
	
				
	$(document).ready(	
		function()
		{
		
<?php include "htm/ready.htm";?>
			$.ajax({
				url:'index.php?act=productlist.get_category_name&product_category=<?php echo $_GET['product_category']; ?>',
				type:'POST',
				success:function(data){
					$('#category_father').text(data);

				}
			});
			
			$.getJSON('index.php?act=productlist.get_parent_category&product_category=<?php echo $_GET['product_category'];?>',function(data){
					$("#original_category").text(data.parent_name);
					
					}
				);
			
			$.getJSON('index.php?act=productlist.category_brother&product_category=<?php echo $_GET['product_category'];?>',function(data){
					for(var category in data)
					{						
						html='<li id=category_'+data[category].category_id+'>'+
						'<a style="TEXT-DECORATION:none" href="'+'parenttypelist.php?product_category=' + data[category].category_id+'">'+data[category].category_name+'</a> '+
						'</li>';
						$('#category_list').append(html);
					}	
					$('#category_'+<?php echo $_GET['product_category'];?>).addClass('active');
					}
				);
		
				
			
			$.getJSON('index.php?act=productlist.parent_type_list&product_category=<?php echo $_GET['product_category']; ?>',function(data){
					var i=0;
					var html ="";			
					for(var product in data)
					{
						if(i==0)
						{html=html+
									'<h3 id="category_father"class="smoke">'+data[product].category_name+'</h3>'+
									'<div class="row-fluid product-row">'+
									'<div class="span10">';
						}
					
						if(i%4==0&&i>0)
						{html=html+'<hr class="type-seperator">'+
									'<h3 id="category_father"class="smoke">'+data[product].category_name+'</h3>'+
									'<div class="row-fluid product-row">'+
									'<div class="span10">';
						}
						html=html+	'<div id="BOOK_ID_00001" class="span3 book-item">'+
									'<div id="label'+i+'"></div>'+
									'<a href="' + 'productDetail.php?product_id=' + data[product].id + '">'+
									'<img src="'+data[product].image+'" class="img-rounded" width="160">'+
									'</a>'+
									'<div class="book-info-list">'+
									'<a href="'+'productDetail.php?product_id=' + data[product].id+'" class="book-name-list">'+data[product].name+'</a>'+
									'<div id="authors">'+
									'<span class="carat juicy">›</span>'+
									'<span class="text-normal" >'+data[product].author+'</span>'+							
									'</div>'+
									'<div class="smoke">平装</div>'+
									'<span class="grey book-price-old">￥'+data[product].price+'</span>'+
									'<span class="red book-price-new">￥'+data[product].current_price+'</span>'+
									'</div>'+
									'</div>';
						if((i+1)%4==0)
						{
							html=html+'</div>'+
									'<div id="subtypeA" class="" style="padding-right:10;">'+
									'<a href="'+'productList.php?product_category=' + data[product].category_id+'" class="orange" style="margin-top:20;float:"><span class="carat">›</span>查看更多</a>'+
									/*'<div class="dark-grey" style="padding-top:10;float:">'+data[category].category_name+'</div>'+*/
									'</div>'+
									'</div>';
									
								
						}
						i++;
						}
						$('#product_list').append(html);
						var a=0;
						for(var product in data)
						{
							if(data[product].discount_type==3)
							{
							html2='<div class="absolute-label">'+
								'<img id = "" style="" src="img/团购图标.png">'+
								'</div>';
							$('#label'+a).append(html2);
							}
							a++;
						}						
					}
				);
			
			
		}
	);
	
	function typeListClick()
	{
		$('#type-list').children(':not(".divider,h2")').click(function(){
			$(this).addClass('active');
			$(this).siblings().removeClass('active');
		});
	}
	</script>
</head>
<body>


<?php include "htm/head.htm";?>
<div class="container-fluid">
  <div class="row-fluid">
    <div class="span3">
      <ul class="nav  nav-pills nav-stacked">
		<h3><div id="original_category" class="nav-header"></div></h3>
       
	   <div id="category_list"> </div>
      
	  </ul>    
    </div>
    <div class="span9">
      <form id="search-box" class="search well hide">
		<input type="text" class="search-query input-xxlarge span10" style="float:left" placeholder="书名&nbsp;&nbsp;/&nbsp;&nbsp;作者&nbsp;&nbsp;/&nbsp;&nbsp;ISBN">
		<button class="btn btn-primary span2" style="float:left">搜索</button>
      </form>
      <div id="type-path">
        <h2 id="category_father" class="juicy"><span class="carat">›</span></h2>
      </div>
	  

	  
	  
	  <div id="product_list"></div>
	  
	

	
	</div>
  </div>
</div>


<?php include "htm/footer.htm";?>
<?php include "htm/copyright.htm";?>
</body>
</html>